package org.example.mytask.controller;

import org.example.mytask.domain.OutboundApplicationReview;
import org.example.mytask.service.OutboundApplicationReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/mytask/outbound")
public class OutboundApplicationReviewController {
    @Autowired
    private OutboundApplicationReviewService outboundService;

    /**
     * RESTful API 资源请求
     * GetMapping 获取资源的请求：select
     * PostMapping 发送、创建资源的请求：insert
     * PutMapping 更新资源的请求：update
     * DeleteMapping 删除资源的请求：delete
     */
//    @RequestMapping("/application/review/selectAll")
    //@GetMapping("/application/review")
    @GetMapping("/list")
    public List<OutboundApplicationReview> selAll(OutboundApplicationReview outboundApplicationReview) {
        return outboundService.findAll(outboundApplicationReview);
    }
    /**
     * 获取出库申请审核
     */
    @GetMapping("/{id}")
    public OutboundApplicationReview getById(@PathVariable("id") int id) {
        return outboundService.getById(id);
    }
    /**
     * 修改出库申请审核
     */
    @PutMapping
    public int update(@RequestBody OutboundApplicationReview
                              outboundApplicationReview) {
        return outboundService.update(outboundApplicationReview);
    }

}
